#ifndef TOPICMANAGER_H
#define TOPICMANAGER_H

#include <QObject>
#include <QList>
#include <QtScript/QScriptEngine>
#include <QtScript/QScriptValue>

#include "contentmanager.h"
#include "model/topic.h"
#include "model/comment.h"

class TopicManager : public ContentManager
{
    Q_OBJECT
public:
    explicit TopicManager();
    void getTopic(const QString &id);
    void getComments(const QString &id, int limit = 20, int offset = 0);
signals:
    void handleTopic(Topic *topic, const QString &msg);
    void handleComments(QList<Comment*> *comments);
private slots:
    void parseData(QScriptValue json, const QString &msg);
private:
};

#endif // TOPICMANAGER_H
